package com.youkeyi.ddy.cloud.common.utils;

import java.util.regex.Pattern;

/**
 * CheckUtils
 *
 * @Author liuxiawang
 * @Date 2024/5/2 11:12 PM
 * @Location shenzhen.china
 */
public class CheckUtils {

    private static final String EMAIL_PATTERN =
            "^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$";

    private static final Pattern EMAIL_REGEX = Pattern.compile(EMAIL_PATTERN);

    public static boolean isValidEmain(String email) {
        if (email == null) {
            return false;
        }
        return EMAIL_REGEX.matcher(email).matches();
    }
}
